[FC-0099] feat: add handler to remove roles when user is retired#110
[FC-0099] feat: add handler to remove roles when user is retired#110mariajgrimaldi merged 20 commits intomainfrom
Conversation
|
Thanks for the pull request, @mariajgrimaldi! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
162adf0 to
a11ae03
Compare
1ad96dd to
92bfa4f
Compare
28bde32 to
a248cf9
Compare
| enforcer = AuthzEnforcer.get_enforcer() | ||
| enforcer.load_policy() |
There was a problem hiding this comment.
Need to drop this.
There was a problem hiding this comment.
I'm curious, why do you need to drop this? is this for performance so we don't load the policy on every call?
|
I'll be working on fixing the failing tests :) |
bmtcril
left a comment
There was a problem hiding this comment.
Looks good to me once the tests are sorted, thanks for taking care of this!
rodmgwgu
left a comment
There was a problem hiding this comment.
Looking great! I'm learning a lot by reading your code, thanks!
|
This PR depends on #100 so this is blocked until it's resolved! Thanks :) |
480ae17 to
8331ed6
Compare
a248cf9 to
3149b6e
Compare
|
@mariajgrimaldi, the PR looks very good, thanks! However, I tried to test it in my local environment by removing a user, and the roles were not deleted. I tried to retire the user in the following two ways:
Neither worked for me. Am I forgetting something? |
Both of those methods move the user into the retirement queue, but unless you're actually running the pipeline the user won't be retired. You can use the retirement tutor plugin with |
|
Thanks for your explanation, @bmtcril! I didn’t know about the whole process. I tested the signal directly in the shell, and it works correctly! ✅ |
BryanttV
left a comment
There was a problem hiding this comment.
Thanks! @mariajgrimaldi
19b6697 to
cbec3e6
Compare
74d93ba to
737c07a
Compare
Description
This PR adds a handler fired when a user is retired to unassign the current roles available in the casbin table, after this operation, all roles are revoked.
How To Test
There are a few integration tests to ensure that when the signal
USER_RETIRE_LMS_CRITICALis sent then roles for the user are revoked. Also, you can test this in a local environment by:(the retirement of a user is kind of annoying to reproduce, hold on tight)
Merge checklist:
Check off if complete or not applicable: